package com.example.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.SysRole;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (SysRole)表数据库访问层
 *
 * @author makejava
 * @since 2022-04-11 23:09:28
 */
public interface SysRoleDao extends BaseMapper<SysRole> {

    @Select("SELECT code, name FROM sys_user_role JOIN sys_role ON sys_user_role.role_id = sys_role.id WHERE user_id = #{uid};")
    List<SysRole> selectRoles(Integer uid);

}

